$OpenBSD: patch-gcc_config_openbsd_h,v 1.3 2012/10/07 20:09:45 landry Exp $
--- gcc/config/openbsd.h.orig	Wed Dec 22 13:06:01 2010
+++ gcc/config/openbsd.h	Sat Oct  6 12:11:38 2012
@@ -109,9 +109,9 @@ while (0)
    This two-stage defines makes it easy to pick that for targets that
    have subspecs.  */
 #ifdef CPP_CPU_SPEC
-#define OBSD_CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
+#define OBSD_CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
 #else
-#define OBSD_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
+#define OBSD_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
 #endif
 
 #undef LIB_SPEC
@@ -295,6 +295,16 @@ __enable_execute_stack (void *addr)					\
   if (mprotect (page, end - page, PROT_READ | PROT_WRITE | PROT_EXEC) < 0) \
     perror ("mprotect of trampoline code");				\
 }
+
+/*
+ * Disable the use of unsafe builtin functions, (strcat, strcpy, stpcpy),
+ * making them easier to spot in the object files.
+ */
+#define NO_UNSAFE_BUILTINS
+
+/* The system headers on OpenBSD are C++-aware.  */
+#undef NO_IMPLICIT_EXTERN_C
+#define NO_IMPLICIT_EXTERN_C
 
 #include <sys/types.h>
 #include <sys/mman.h>
